var id = getCookie("id");
// alert(id)
if (id == null){
    window.location.href = "login.jsp"
}else {
    $(function () {
        $.ajax({
            url: "http://localhost:80/emp/load.do",
            type: "post",
            dataType: "json",
            data: {"eid": id},
            success: function (result) {
                if (result.status == 0) {
                    var name = result.data.ename;
                    var age = result.data.eage;
                    var password = result.data.pwd;
                    var deptid = result.data.deptid;
                    // console.log(id,name,age,password,deptid)

                    $("#id").html("用户id："+id)
                    $("#name").html("用户名："+name)
                    $("#age").html("年龄："+age)
                    $("#password").html("密码："+password)
                    $("#deptid").html("部门编号："+deptid)
                }
            },
            error: function(){
                alert("登录失败！")
            }
        })
    })
}